package com.dm.script.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import javax.annotation.Resource;

/***
 * @Author maochuang.li
 *
 * @Email itdreamlmc@163.com
 *
 * @Date Create in 11:48 2017/10/15 0015
 */
@Service("redisService")
public class RedisService {

    @Autowired
    private RedisTemplate redisTemplate;

    public String getKey(String key) {
        return (String) redisTemplate.opsForValue().get(key);
    }


    public void setKey(String key, String value) {
        redisTemplate.opsForValue().set(key, value);
    }
}
